home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / msc3strn.arc / MSC3STRN.PAT
Encoding:
Text File  |  1986-04-04  |  1.1 KB  |  41 lines

  1. u 14f l 24
  2. a 164
  3. ; Bug Fix for MSC 3.0 strncmp()     Memory Model(s): S,M,L
  4. ;
  5. ; The following fix corrects a bug in the function strncmp() from
  6. ;   the Microsoft C 3.0 Compiler Library.
  7. ; The original code would always search through memory (up to 65535
  8. ;   bytes) until it found a zero byte, regardless of the length
  9. ;   specified by the caller. This approach returns a correct value,
  10. ;   but has nasty effects on performance when used to compare non-
  11. ;   terminated strings.
  12. ; To apply this fix, extract strncmp.obj from slibc.lib (or 
  13. ;   mlibc or llibc) with:
  14. ;       LIB slibc *strncmp;
  15. ; Then patch the object module and create a new library
  16. ;       DEBUG strncmp.obj <msc3strn.pat
  17. ; Next, create a new object library to contain the fixed module
  18. ;       LIB sfixlibc +strncmp;
  19. ; Finally, whereever LINK with slibc, use sfixlibc+slibc instead.
  20. ;
  21. ; Bug Reported to Microsoft 03/14/86.
  22. ;
  23. ;          Frank McKenney, McKenney Associates
  24. ;          Richmond, Virginia   (804) 320-4887
  25. repnz
  26. scasb
  27. jcxz 170
  28. sub cx,bx
  29. neg cx
  30. jmp short 172
  31. nop
  32. nop
  33. mov cx,bx
  34.  
  35. u 14f l 24
  36. w
  37. q
  38.  Virginia   (804) 320-4887
  39. repnz
  40. scasb
  41. j